package boot.spring.po;

import java.util.Date;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import com.alibaba.fastjson.annotation.JSONField;

@Document(indexName = "city",type = "_doc", shards = 3, replicas = 1)
public class City {
	@Id
	private short cityId;
	private String city;
	@Field(type = FieldType.Date, format = DateFormat.custom, pattern="yyyy-MM-dd HH:mm:ss")
	private String lastUpdate;
	Short countryId;
	
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public short getCityId() {
		return cityId;
	}
	public void setCityId(short cityId) {
		this.cityId = cityId;
	}
	
	public String getLastUpdate() {
		return lastUpdate;
	}
	public void setLastUpdate(String lastUpdate) {
		this.lastUpdate = lastUpdate;
	}
	public Short getCountryId() {
		return countryId;
	}
	public void setCountryId(Short countryId) {
		this.countryId = countryId;
	}
	@Override
	public String toString() {
		return "City [cityId=" + cityId + ", city=" + city + ", lastUpdate=" + lastUpdate + ", countryId=" + countryId
				+ "]";
	}
	
}
